package com.example.orderserver.feign;

import com.example.productserver.entity.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author whx
 * @date 2022/4/4
 */
@FeignClient(name = "product-server",url = "localhost:9091")
public interface ProductApi {

    @GetMapping("list")
    List<Product> list();

    @PostMapping("save")
    String save();

    @PostMapping("reduceInventory")
    String reduceInventory(@RequestParam("productId") Long productId,@RequestParam("number") Integer number);
}
